package com.dj.ssm.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author hzz
 */
@Data
public class ExamQ {

    private Integer id;

    private String examName;

    private Integer nend;

    private Integer upper;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private LocalDateTime startTime;
    private String startTimeShow;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private LocalDateTime endTime;
    private String endTimeShow;

    public String getStartTimeShow() {
        if(startTime==null) {
            return"";
        }
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String format = dateTimeFormatter.format(startTime);
        return format;
    }


    public String getEndTimeShow() {
        if(endTime==null) {
            return"";
        }
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String format = dateTimeFormatter.format(endTime);
        return format;
    }
    /*未开始/进行中/已结束*/
    private String status;
}
